﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
namespace MySpace
{
    // 此脚本用于生成两类对象（牧师或魔鬼）
    public class Character
    {
        public GameObject Role { get; set; }
        public CoastController coast { get; set; }
        public bool OnBoat { get; set; }
        public readonly float speed = 15;

        public string Name
        {
            get
            {
                return Role.name;
            }
            set
            {
                Role.name = value;
            }
        }

        public Character(string _name)
        {
            if(_name.Contains("Priest"))
            {
                Role = Object.Instantiate(Resources.Load("Prefab/Priest", typeof(GameObject)), Vector3.zero, Quaternion.Euler(0,0,0), null) as GameObject;
            }
            else
            {
                Role = Object.Instantiate(Resources.Load("Prefab/Devil", typeof(GameObject)), Vector3.zero, Quaternion.Euler(0, 0, 0), null) as GameObject;
            }
            OnBoat = false;
            Name = _name;
        }
    }
}